<template>
  <div id="app">
    <transition :name="routerTransition">
      <keep-alive>
        <router-view />
      </keep-alive>
    </transition>
  </div>
</template>

<script>
import { setDocumentTitle } from '@/utils';

export default {
  name: 'App',
  data() {
    return {
      routerTransition: 'router-slide-left',
    };
  },
  watch: {
    $route(to, from) {
      setDocumentTitle(to.meta.title);

      this.routerTransition = from.meta.routerTransition;
    },
  },
};
</script>

<style lang="stylus">
@import 'style/theme.styl';
</style>
